
package cn.jolyoulu.test.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.jolyoulu.common.web.entity.ResultInfo;

import java.util.List;
import java.util.Map;

/**
 * @Author LuZhouJin
 * @Date 2023/5/4
 * druid-module 测试
 */
@RestController
@RequestMapping("/test/druid")
public class TestDruidController {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    //测试druid连接池功能
    @GetMapping("/test")
    public ResultInfo<List<Map<String, Object>>> druid() {
        return ResultInfo.success(jdbcTemplate.queryForList("SELECT * FROM test"));
    }
}
